_eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn, _eeee_llll_ffff______nnnn_eeee_xxxx_tttt, _eeee_llll_ffff______rrrr_aaaa_nnnn_dddd, and _eeee_llll_ffff______eeee_nnnn_dddd work together to process ELF
object files, either individually or as members of archives. After
obtaining an ELF descriptor from _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn, the program may read an
existing file, update an existing file, or create a new file. _f_i_l_d_e_s is
an open file descriptor that _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn uses for reading or writing. The
initial file offset [see _llll_ssss_eeee_eeee_kkkk(2)] is unconstrained, and the resulting
file offset is undefined.
_c_m_d may have the following values.
_EEEE_LLLL_FFFF______CCCC______NNNN_UUUU_LLLL_LLLL When a program sets _c_m_d to this value, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn returns
a null pointer, without opening a new descriptor. _r_e_f is
ignored for this command. See _eeee_llll_ffff______nnnn_eeee_xxxx_tttt(3E) and the
examples below for more information.
_EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD When a program wishes to examine the contents of an
existing file, it should set _c_m_d to this value.
Depending on the value of _r_e_f, this command examines
archive members or entire files. Three cases can occur.
First, if _r_e_f is a null pointer, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn allocates a
new ELF descriptor and prepares to process the entire
file. If the file being read is an archive, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn
also prepares the resulting descriptor to examine the
initial archive member on the next call to _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn, as
if the program had used _eeee_llll_ffff______nnnn_eeee_xxxx_tttt or _eeee_llll_ffff______rrrr_aaaa_nnnn_dddd to ``move''
to the initial member.
Second, if _r_e_f is a non-null descriptor associated with
an archive file, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn lets a program obtain a
separate ELF descriptor associated with an individual
member. The program should have used _eeee_llll_ffff______nnnn_eeee_xxxx_tttt or
_eeee_llll_ffff______rrrr_aaaa_nnnn_dddd to position _r_e_f appropriately (except for the
initial member, which _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn prepares; see the example
below). In this case, _f_i_l_d_e_s should be the same file
descriptor used for the parent archive.
Finally, if _r_e_f is a non-null ELF descriptor that is not
an archive, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn increments the number of
activations for the descriptor and returns _r_e_f, without
allocating a new descriptor and without changing the
descriptor's read/write permissions. To terminate the
descriptor for _r_e_f, the program must call _eeee_llll_ffff______eeee_nnnn_dddd once
for each activation. See _eeee_llll_ffff______nnnn_eeee_xxxx_tttt(3E) and the examples
below for more information.
_EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD______MMMM_MMMM_AAAA_PPPP This command duplicates the actions of _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD but
uses the _mmmm_mmmm_aaaa_pppp() system call to access the file data in a
more memory efficient manner. If, after _l_i_b_e_l_f has
opened the file, another process truncates the file
_l_i_b_e_l_f could get a Segmentation Violation attempting to
read data it believes is in the file (but which is no
longer there due to the truncation). Applications
calling _l_i_b_e_l_f with _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD______MMMM_MMMM_AAAA_PPPP may therefore wish to
install a signal handler for _SSSS_IIII_GGGG_SSSS_EEEE_GGGG_VVVV (Segmentation
Violation) and issue a message when it happens.
_EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR This command duplicates the actions of _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD and
additionally allows the program to update the file image
[see _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee(3E)]. That is, using _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD gives a
read-only view of the file, while _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR lets the
program read _a_n_d write the file. _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR is not valid
for archive members. If _r_e_f is non-null, it must have
been created with the _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR command.
_EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE If the program wishes to ignore previous file contents,
presumably to create a new file, it should set _c_m_d to
COFF is an object file format that preceded ELF . COFF object files
cannot be used with this library.
_EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD______MMMM_MMMM_AAAA_PPPP and _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE______FFFF_AAAA_SSSS_TTTT are options specific to this
implementation, not options which are generally available.